﻿@using Model;
@{
    ViewBag.Title = "标签列表";
    ViewBag.TagCss = "active";
    List<Tag> list = ViewBag.list;
}

<ul class="breadcrumb">
    <li>标签管理<span class="divider">/</span></li>
    <li class="active">@ViewBag.Title</li>
</ul>
<div class="container-fluid">
    <div class="row-fluid">

        <div class="row-fluid">

            <div class="btn-toolbar">
                <a class="btn" href="/Admin/Tag/Add"><i class="fa fa-plus"></i> 新增</a>

            </div>
            <div class="well">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th style="width:60px;">编号</th>
                            <th style="width:100px;">名称</th>
                            <th style="width:60px;">文章数量</th>
                            <th style="width:200px;">摘要</th>
                            <th style="width:150px;">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in list)
                        {
                            <tr>
                                <td>@item.tag_id</td>
                                <td>@item.tag_name</td>
                                <td>@item.tag_count</td>
                                <td>@item.tag_mate</td>
                                <td>
                                    <a class="btn btn-info" href="/Admin/Tag/Edit/@item.tag_id"><i class="fa fa-edit"></i> 编辑</a>
                                    <a class="btn btn-danger" onclick="del(@item.tag_id)"><i class="fa fa-trash-o"></i> 删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            

        </div>


        @Html.Partial("_footer")

    </div>
</div>
<script>
    function del(id)
    {
        ConfirmDialog('确定要删除这条数据？', function () {
            AjaxGet('/Admin/Tag/Delete/', { 'id': id }, function (mess) {
                AlertDialog(mess.msg, function () {
                    if(mess.code==200)
                    {
                        location.href = "/Admin/Tag/List";
                    }
                });
            });
        });
    }
</script>

